package com.study.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;

/**
 * JsonIgnore 注解，作用在属性上。
 * 将对象返回给前端时，被修饰的字段会被忽略，但相应的，前端传递过来的字段也会被忽略
 */
@Data
public class BaseDO {

    @TableId(value = "id", type = IdType.AUTO)
    @ApiModelProperty("主键")
    private Long id;

    @JsonIgnore
    @TableLogic(value = "0", delval = "id")
    @ApiModelProperty("删除标志")
    private Long isDelete;

    @JsonIgnore
    @ApiModelProperty("创建者账号")
    private String createBy;

    @JsonIgnore
    @ApiModelProperty("更新者账号")
    private String updateBy;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty("创建时间")
    private Date createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty("更新时间")
    private Date updateTime;

}
